//
//  XDHabitBannerCell.m
//  XDEducation
//
//  Created by apple on 2017/4/13.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "XDHabitBannerCell.h"
#import "XDScrollView.h"
@interface XDHabitBannerCell ()
/** banner view */
@property(nonatomic,strong) XDScrollView *bannerView ;
@end

static NSString *const bannerCellId = @"bannerCell";

@implementation XDHabitBannerCell
{
    NSMutableArray *_imageArr;
}
+(instancetype)habitBannerCellWithTableView:(UITableView *)tableView imageArr:(NSMutableArray *)imageArr{

    XDHabitBannerCell *cell = [tableView dequeueReusableCellWithIdentifier:bannerCellId];
    
    if (!cell) {
        
        cell = [[XDHabitBannerCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:bannerCellId imageArr:imageArr];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier imageArr:(NSMutableArray *)imageArr{

    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        _imageArr = imageArr;

    }
    return self;
}


-(void)layoutSubviews{

    [super layoutSubviews];
    
    _bannerView = [[XDScrollView alloc]initWithFrame:CGRectMake(0, 0, self.width, self.height) imageArr:_imageArr];
    
    [self.contentView addSubview:_bannerView];
}

@end
